import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Cards {
    private List<Card> list;
    private static final String[] suits = {"♦", "♥", "♣", "♠"};
    public Cards() {
        this.list = new ArrayList<>();
        for (int i = 0; i < 4; i++) {
            for (int j = 1; j <= 13; j++) {
                Card card = new Card(suits[i], j);
                this.list.add(card);
            }
        }
    }

    public void shuffleCards(){
        Random random = new Random();
        for (int i = list.size() - 1; i > 0; i--) {
            int j = random.nextInt(i);
            swap(i, j);
        }
    }
    private void swap(int i, int j){
        Card tmp = list.get(i);
        list.set(i, list.get(j));
        list.set(j, tmp);
    }

    public List<Card> getList() {
        return list;
    }

    public void setList(List<Card> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "Cards{" +
                "list=" + list +
                '}';
    }
}
